<?php 

include './setPhp.php';
$id_pwd = include 'id_pwd.php';
if(is_post())
{
	$dat = $_POST;
	if(array_key_exists($dat['dl_name'],$id_pwd)){
		if($id_pwd[$dat['dl_name']] == $dat['dl_pwd']){
			$data = include './login_data.php';
			unset($dat['dl_pwd']);
			$data[] = $dat;
			data_to_file('./login_data.php', $data);
			echo "<script>location.href='./index.php';</script>";
		}
		else {
			echo "<script>alert('密码错误');</script>";
			echo "<script>location.href='./index.php';</script>";
		}
	}else{
		echo "<script>alert('用户名不存在！');</script>";
		echo "<script>location.href='./index.php';</script>";
	}
}


?>